package com.wx.wxapp.controller;

import com.wx.wxapp.entity.Food;
import com.wx.wxapp.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;
import java.util.Map;

@RestController
public class FoodController {
    @Autowired
    private FoodService foodService;


    /*
     *   功能：获取用户关于食物经验的发帖纪录
     *   参数：
     *       openid:用户的openid
     * */
    @RequestMapping(value = "/getHistoryFoodCards",method = RequestMethod.GET)
    public List<List<String>> GetHistoryFoodCards(@RequestParam("openid")String openid){
        return foodService.getHistoryFoodCard(openid);
    }
    @RequestMapping(value = "/getFoodCards",method = RequestMethod.GET)
    public Map GetFoodCards(@RequestParam("pageNumber")int pageNumber){
        return foodService.getFoodCard(pageNumber);
    }
}
